package com.acsior.hibernate.vo;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;

/**
 * MarketingService entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "marketing_services")
@GeneratorKey(tableName = "service_requests")
public class MarketingServiceVO extends ServiceRequestVO {

	private static final long serialVersionUID = -487640667310950L;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "customer_id", nullable = false)
	private CustomerVO customer;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "marketingService")
	private List<MarketingServiceAttributeVO> marketingServiceAttributes;

	/** default constructor */
	public MarketingServiceVO() {
		this.marketingServiceAttributes = new ArrayList<MarketingServiceAttributeVO>();
	}

	/** @return the customer */
	public CustomerVO getCustomer() {
		return this.customer;
	}

	/** @return the marketingServiceAttributes */
	public List<MarketingServiceAttributeVO> getMarketingServiceAttributes() {
		return this.marketingServiceAttributes;
	}

	/**
	 * @param customer
	 *            the customer to set
	 */
	public void setCustomer(CustomerVO customer) {
		this.customer = customer;
	}

	/**
	 * @param marketingServiceAttributes
	 *            the marketingServiceAttributes to set
	 */
	public void setMarketingServiceAttributes(
			List<MarketingServiceAttributeVO> marketingServiceAttributes) {
		this.marketingServiceAttributes = marketingServiceAttributes;
	}

}